include(AwsLibFuzzer)
include(AwsTestHarness)
enable_testing()

file(GLOB TEST_HDRS "*.h")
file(GLOB TEST_SRC "*.c")

file(GLOB TESTS ${TEST_HDRS} ${TEST_SRC})

add_test_case(sha256_nist_test_case_1)
add_test_case(sha256_nist_test_case_2)
add_test_case(sha256_nist_test_case_3)
add_test_case(sha256_nist_test_case_4)
add_test_case(sha256_nist_test_case_5)
add_test_case(sha256_nist_test_case_5_truncated)
add_test_case(sha256_nist_test_case_6)
add_test_case(sha256_test_invalid_buffer)
add_test_case(sha256_test_oneshot)
add_test_case(sha256_test_invalid_state)
add_test_case(sha256_test_extra_buffer_space)

add_test_case(sha1_nist_test_case_1)
add_test_case(sha1_nist_test_case_2)
add_test_case(sha1_nist_test_case_3)
add_test_case(sha1_nist_test_case_4)
add_test_case(sha1_nist_test_case_5)
add_test_case(sha1_nist_test_case_5_truncated)
add_test_case(sha1_nist_test_case_6)
add_test_case(sha1_test_invalid_buffer)
add_test_case(sha1_test_oneshot)
add_test_case(sha1_test_invalid_state)
add_test_case(sha1_test_extra_buffer_space)

add_test_case(md5_rfc1321_test_case_1)
add_test_case(md5_rfc1321_test_case_2)
add_test_case(md5_rfc1321_test_case_3)
add_test_case(md5_rfc1321_test_case_4)
add_test_case(md5_rfc1321_test_case_5)
add_test_case(md5_rfc1321_test_case_6)
add_test_case(md5_rfc1321_test_case_7)
add_test_case(md5_rfc1321_test_case_7_truncated)
add_test_case(md5_verify_known_collision)
add_test_case(md5_invalid_buffer_size)
add_test_case(md5_test_invalid_state)
add_test_case(md5_test_extra_buffer_space)

add_test_case(sha256_hmac_rfc4231_test_case_1)
add_test_case(sha256_hmac_rfc4231_test_case_2)
add_test_case(sha256_hmac_rfc4231_test_case_3)
add_test_case(sha256_hmac_rfc4231_test_case_4)
add_test_case(sha256_hmac_rfc4231_test_case_5)
add_test_case(sha256_hmac_rfc4231_test_case_6)
add_test_case(sha256_hmac_rfc4231_test_case_7)
add_test_case(sha256_hmac_test_oneshot)
add_test_case(sha256_hmac_test_invalid_buffer)
add_test_case(sha256_hmac_test_invalid_state)
add_test_case(sha256_hmac_test_extra_buffer_space)

add_test_case(ecdsa_p256_test_pub_key_derivation)
add_test_case(ecdsa_p384_test_pub_key_derivation)
add_test_case(ecdsa_p256_test_known_signing_value)
add_test_case(ecdsa_p384_test_known_signing_value)
add_test_case(ecdsa_test_invalid_signature)
add_test_case(ecdsa_p256_test_key_gen)
add_test_case(ecdsa_p384_test_key_gen)
add_test_case(ecdsa_p256_test_key_gen_export)
add_test_case(ecdsa_p384_test_key_gen_export)
add_test_case(ecdsa_p256_test_import_asn1_key_pair)
add_test_case(ecdsa_p384_test_import_asn1_key_pair)
add_test_case(ecdsa_test_import_asn1_key_pair_public_only)
add_test_case(ecdsa_test_import_asn1_key_pair_invalid_fails)
add_test_case(ecdsa_test_signature_format)
add_test_case(ecdsa_p256_test_small_coordinate_verification)

add_test_case(der_encode_integer)
add_test_case(der_encode_boolean)
add_test_case(der_encode_null)
add_test_case(der_encode_bit_string)
add_test_case(der_encode_octet_string)
add_test_case(der_encode_sequence)
add_test_case(der_encode_set)

add_test_case(der_decode_integer)
add_test_case(der_decode_boolean)
add_test_case(der_decode_null)
add_test_case(der_decode_bit_string)
add_test_case(der_decode_octet_string)
add_test_case(der_decode_sequence)
add_test_case(der_decode_set)
add_test_case(der_decode_key_pair)

add_test_case(ecc_key_pair_random_ref_count_test)
add_test_case(ecc_key_pair_public_ref_count_test)
add_test_case(ecc_key_pair_asn1_ref_count_test)
add_test_case(ecc_key_pair_private_ref_count_test)

generate_test_driver(${PROJECT_NAME}-tests)
